package com.vc.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.vc.model.entity.user.User;
import com.vc.user.dao.IUserDao;

@Service
//@Transactional(propagation=Propagation.REQUIRED,isolation=Isolation.SERIALIZABLE)
public class UserServiceImpl implements IUserService {

	@Autowired
	private IUserDao userDao;

	@Override
	public Integer add(Integer a,Integer b) {
		User user = userDao.findById((long)10);
		return a+b;
	}

	@Override
	@Transactional
	public User add(User user) {
		User u = userDao.save(user);
		return u;
		//throw new BusinessException("测试一下事务!");
	}
	
}
